package Eyjafjalla.card.skill;

import Eyjafjalla.action.SwapHandCloudAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.power.WhiteCloudPower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class CloudyBarrier_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "CloudyBarrier_Eyjafjalla";
    private static final CardStrings cardStrings;

    public CloudyBarrier_Eyjafjalla(){
        super(ID, cardStrings.NAME,2,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.UNCOMMON,CardTarget.ENEMY);
        this.baseBlock = 14;
        this.block = 14;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new CloudyBarrier_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new GainBlockAction(p,this.block));
        addToBot(new ApplyPowerAction(m,p,new WhiteCloudPower(m,1),1));
        if(isFire()){
            AbstractMonster rm = AbstractDungeon.getRandomMonster();
            addToBot(new ApplyPowerAction(rm,p,new WhiteCloudPower(rm,1),1));
        }
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBlock(4);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


